<template>
  <div id="app">
    <!--6、router-link访问对应的路由，通过router-view来渲染路由组件-->
    <!--router-link 相当于a标签 to属性相当于a标签的href-->
      <!--命名路由配置-->
        <router-link :to="{name:'home'}">首页</router-link> | 
        <router-link :to="{name:'about'}">关于</router-link> | 
        <router-link :to="{name:'user',params:{id:1}}">用户1</router-link> | 
        <router-link :to="{name:'user',params:{id:2}}">用户2</router-link> | 
        <router-link :to="{name:'page',query:{id:1,title:'foo'}}">page</router-link>  |  
        <router-link :to="{name:'notes'}">我的笔记</router-link> | 
        <router-link :to="{name:'eaditor'}">编辑</router-link> | 
        <router-link :to="{name:'blog'}">博客</router-link> | 
   
      <!--命名路由-->
    <!-- <router-link :to="{name:'home'}">首页</router-link>| 
    <router-link :to="{name:'about'}">关于</router-link> -->
    <!-- router-view 相当于路由组件的出口-->
    <router-view></router-view>
  </div>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
